//---------------------------------------------------------------------------

#include "vcl_stl.h"
#pragma hdrstop

#include "h_base.h"
#include "h_xml.h"
#include "h_global.h"
using namespace h_base;
using namespace h_xml;

#include "h_g.h"

#include "t_selectskinform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TSelectSkinForm *SelectSkinForm;
//---------------------------------------------------------------------------
__fastcall TSelectSkinForm::TSelectSkinForm(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
UTF8String __fastcall TSelectSkinForm::Select()
{
   OkFlag = false;
   ComboBoxGroup->Items->Clear();

   TSearchRec SearchRec;
   int Attr = faDirectory;

   if ( FindFirst(h_g::BaseDir + "skin\\*.*", Attr, SearchRec) != 0 )
   {
      h_g::ShowMessage("FindFirst fail");
      FindClose(SearchRec);
      return "";
   }

   for ( ; ; )
   {
      if ( SearchRec.Name != "." && SearchRec.Name != ".." )
      {
         ComboBoxGroup->Items->Add(SearchRec.Name);
      }
      if ( FindNext(SearchRec) != 0 )
      {
         break;
      }
   }

   ComboBoxGroup->ItemIndex = 0;
   ShowModal();

   if( OkFlag )
   {
      return ComboBoxGroup->Text;
   }
   else
      return "";

}
void __fastcall TSelectSkinForm::ButtonOkClick(TObject *Sender)
{
   OkFlag = true;
   Close();
}
//---------------------------------------------------------------------------
void __fastcall TSelectSkinForm::ButtonCancelClick(TObject *Sender)
{
   Close();
}
//---------------------------------------------------------------------------

